﻿@using Orchard.ContentManagement

@{
    var userCanRegister = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}
<div class="well well-sm logreg col-xs-12 col-md-6 col-md-offset-3">
    <h3>Sign In to @WorkContext.CurrentSite.SiteName</h3>
    <hr />
    @using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { @class = "form-horizontal" })) {
        <!-- Username -->
        <div class="form-group">
            <label for="userNameOrEmail" class="col-lg-3 control-label">@T("Username")</label>
            <div class="col-lg-9">
                @Html.TextBox("userNameOrEmail", "", new { id = "username-email", @class = "form-control", autofocus = "autofocus" })
                @Html.ValidationMessage("userNameOrEmail")
            </div>
        </div>
        <!-- Password -->
        <div class="form-group">
            <label for="password" class="col-lg-3 control-label">@T("Password")</label>
            <div class="col-lg-9">
                @Html.Password("password", string.Empty, new { @class = "form-control" })
                @Html.ValidationMessage("password")
            </div>
        </div>
        <!-- Remember me -->
        <div class="form-group">
            <div class="col-lg-offset-3 col-lg-9">
                <div class="checkbox">
                    <label>
                        @Html.CheckBox("rememberMe", new { id = "remember-me" })
                        @T("Remember me")
                    </label>
                </div>
            </div>
        </div>
        <!-- Buttons -->
        <div class="form-group">
            <div class="col-lg-offset-3 col-lg-9">
                <button type="submit" class="btn btn-primary">@T("Login")</button>
                <button type="reset" class="btn btn-default">@T("Reset")</button>
            </div>
        </div>
    }
    @if (userCanRegister) {
        <hr />
        <div class="lregister">
            Don't have Account? @Html.ActionLink(T("Register").Text, "Register")<br />
            @if (enableLostPassword) { @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
        </div>
    }
</div>
